package cn.lixin.hrm;

import cn.lixin.EsApp;
import cn.lixin.hrm.doc.CourseDoc;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.elasticsearch.core.ElasticsearchTemplate;
import org.springframework.stereotype.Repository;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = EsApp.class)
@Repository
public class CourseDocTest {

    @Autowired
    private ElasticsearchTemplate elasticsearchTemplate;


    @Test
    public void testCreateIndex(){
        elasticsearchTemplate.putMapping(CourseDoc.class);
        elasticsearchTemplate.createIndex(CourseDoc.class);
    }
}
